/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.cs.volume.Volume;
/*    */ import com.zimbra.cs.volume.VolumeManager;
/*    */ import com.zimbra.soap.JaxbUtil;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import com.zimbra.soap.admin.message.GetAllVolumesRequest;
/*    */ import com.zimbra.soap.admin.message.GetAllVolumesResponse;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class GetAllVolumes
/*    */   extends AdminDocumentHandler
/*    */ {
/*    */   public Element handle(Element req, Map<String, Object> ctx)
/*    */     throws ServiceException
/*    */   {
/* 38 */     ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
/* 39 */     return zsc.jaxbToElement(handle((GetAllVolumesRequest)JaxbUtil.elementToJaxb(req), ctx));
/*    */   }
/*    */   
/*    */   private GetAllVolumesResponse handle(GetAllVolumesRequest req, Map<String, Object> ctx) throws ServiceException
/*    */   {
/* 44 */     ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
/* 45 */     checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Rights.Admin.R_manageVolume);
/*    */     
/* 47 */     GetAllVolumesResponse resp = new GetAllVolumesResponse();
/* 48 */     for (Volume vol : VolumeManager.getInstance().getAllVolumes()) {
/* 49 */       resp.addVolume(vol.toJAXB());
/*    */     }
/* 51 */     return resp;
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 56 */     relatedRights.add(Rights.Admin.R_manageVolume);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/GetAllVolumes.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */